package com.lz.sports.bean

import androidx.room.Embedded
import androidx.room.Relation

//考试成绩带信息
class ExamResultWithInfo {

    //考生信息
    @Embedded
    var examResult: ExamResult? = null

    @Relation(
        parentColumn = "examineeId",
        entityColumn = "id"
    )
    var examinee: Examinee? = null

    fun isInvalid(): Boolean = examResult == null || examinee == null

    fun resultWithInfo(): ExamResult? = if (!isInvalid()) examResult!!.also { it.examinee = examinee } else null
}